<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2021/6/1
  Time: 9:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/common/common.jsp" %>
<html>
<head>
    <title>Title</title>
    <style>
        .file-preview {
            height: 400px;
        }
    </style>
    <script>
        $(function () {
            $('#myFile').fileinput({
                language: 'zh',
                uploadUrl: "<%=path%>/file/upLoadFile",
                browseClass: 'btn btn-success',
                maxFileCount: 3,
                enctype: "multipart/form-data",
                maxFileSize: 999999, // 单位kb
                allowedFileExtensions: ['jpg', 'png', 'gif'],
            });

            // ajax上传成功之后调用该事件
            $('#myFile').on("fileuploaded", function (event, data, previewId, index) {
                var fileUrl = data.response.imgUrl;
                $("#img_url").val(fileUrl)
            })
        })


    </script>
</head>
<body>
<form id="add_form">

    旅游地风景 <input type="text" name="rname"><br>

    旅游地价格 <input type="text" name="price"><br>

    '旅游地简介 <input type="text" name="routeintroduce"><br>

    是否是旅游主题:<input type="radio" name="rflag" value="1">上架

    <input type="radio" name="rflag" value="2">下架

    上架时间 <input type="date" name="rdate"><br>

    是否是旅游主题: <input type="radio" name="isthemetour" value="0">是

    <input type="radio" name="isthemetour" value="1">不是<br>

    收藏数量: <input type="text" name="count"><br>

    抓取数据的来源id <input type="text" name="sourceid"><br>

    旅游线路分类表: <select name="sid" id="sid">
    <c:forEach items="${s}" var="s">
        <option value="${s.sid}">${s.sname}</option>
    </c:forEach>

</select><br><br>
    所属商家表 <select id="cid" name="cid">
    <c:forEach items="${c}" var="c">
        <option value="${c.cid}">${c.cname}</option>
    </c:forEach>
</select><br><br>
    <div class="container-fluid">
        <div class="panel panel-primary" style="width:400px">
            <div class="panel-heading">
                <h1>图片上传</h1>
            </div>
            <div class="form-group">
                <label for="myFile">头像</label>
                <input type="file" class="form-control" name="myFile" id="myFile" multiple>
            </div>
            <input type="text" name="rimage" id="img_url">
        </div>
    </div>
    </div><br>
</form>

</body>
</html>
